package com.qtu.gateway.feign;

import com.qtu.gateway.feign.fallback.GatewayFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Component
@FeignClient(value = "redis-service",fallback = GatewayFeignFallBack.class)
public interface GatewayFeignService {
    /**
     * 获取数据
     */
    @ResponseBody
    @RequestMapping("api/redis/get")
    Object get(@RequestParam("key") String key);

    /**
     * 根据 key,判断 value是否存在
     */
    @ResponseBody
    @RequestMapping("api/redis/exists")
    String exists(@RequestParam("key") String key);
}
